package TimelyBasedEventSystem.RatingMatrix;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *This class is to generate random Nodes
 * In Face book Language, this class is 
 * For generating friends profile randomly.
 * @author Niraj Bhagchandani
 * @version 1.0
 * @since 24/03/2013
 */
import RatingMatrix.*;
import java.util.Random;

public class RandomNodes {
     /**
     * Class Constructor - Creating default values to 
     * initialize the friends list.
     * @param id 
     * 24/03/2013
     */
    public RandomNodes(Integer id, int scale){
        //log("Generating values for your friend:");
        setName("User"+id);
        Random randomGenerator = new Random();
        setScale(scale);
        Integer randomInt = randomGenerator.nextInt(getScale());
        Integer randomIsAlive = randomGenerator.nextInt(2);
        for(int i=0;randomInt ==0;i++){
            randomInt = randomGenerator.nextInt(5);
        }
        setVote(randomInt);
        setId(id);
        if(randomIsAlive == 1)
          setIsAlive(true);
      
        else
            setIsAlive(false);
        
        //log(getName());
       // log("Values for id:" +getId().toString());
      //  log("Values for name:"+getName());
       // log("Values for vote:" +getVote());
      // log("Values for isAlive:"+getIsAlive());
    }

    /**
     * This variable is used to define the scaling factor
     * i.e between 1-5 or 1-10 and so on. for voting
     * 24/03/2013
     */
    protected int scale;

    /**
     * This string is used to store the name of the friend
     * Here, name is also randomly generated from the source - id
     * Access Protection - protected
     * 24/03/2013
     */
    protected String name;
    
    /**
     * This string will generate the random votes for friends.
     * Here, vote is randomly generated.
     * Access Protection - protected
     * 24/03/2013
     */
    protected Integer vote;
    
    /**
     * this is to give the unique identification to our friend.
     * Access Protection - protected
     * 24/03/2013
     */
    protected Integer id;


    /**
     * This variable is used make friend online or offline
     * Access Protection - protected
     * 24/03/2013
     */
    protected boolean isAlive;

    /**
     * Getter method for isAlive variable
     * @return isAlive
     * 24/03/2013
     */
    public boolean getIsAlive() {
        return isAlive;
    }

    /**
     * Setter method for isAlive variable
     * @param isAlive 
     * 24/03/2013
     */
    
    public void setIsAlive(boolean isAlive) {
        this.isAlive = isAlive;
    }
     /**
     * Getter method for Scale variable
     * @return scale
     * 24/03/2013
     */
    public int getScale() {
        return scale;
    }
    

    /**
     * Setter method for scale variable
     * @param scale 
     * 24/03/2013
     */
    public void setScale(int scale) {
        this.scale = scale;
    }
    
    /**
     * Setter method for name Variable
     * @param name 
     * 24/03/2013
     */
    
    public void setName(String name) {
        this.name = name;
    }
    
    /**
     * Setter method for vote variable
     * @param vote
     * 24/03/2013
     */
    public void setVote(Integer vote) {
        this.vote = vote;
    }

    /**
     * Setter method for id variable
     * @param id 
     * 24/03/2013
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * Getter method for name variable
     * @return name
     * 24/03/2013
     */
    public String getName() {
        return name;
    }

    /**
     * Getter method for vote variable
     * @return vote
     * 24/03/2013
     */
    public Integer getVote() {
        return vote;
    }
    
    /**
     * Getter method for id variable
     * @return id
     * 24/03/2013
     */
    public Integer getId() {
        return id;
    }
    
    
    public static void main(String args[]){    
       
       RandomNodes rand = new RandomNodes(5,5);
    }

    protected void log(String aMessage){
        System.out.println(aMessage);
    }

    
}
